refactor: Gateway interface split, output standardization, dedup#29
Merged
Conversation
…24,#27) Gateway interface (#27): Split into focused sub-interfaces aligned with OpenShell proto domains: ProviderManager, SandboxManager, InferenceConfig, GatewayAdmin. Gateway composes all four. profile.ValidateProviders now accepts ProviderChecker (single method) instead of full Gateway — mock dropped from 24 stubs to 1. Code deduplication (#24): - Extract k8s.DefaultNamespace() — was in 3 cmd files - Extract k8s.FileExists() — was in cmd/providers.go + launcher - Profile mock simplified (24 → 1 stub method) Output standardization (#23): - All cmd/ files now use status.* helpers instead of raw fmt.Print - Added status.Warn, Warnf, Infof, Detailf, Step, Done - creds.go: 15 raw lines → all status helpers - deploy.go: numbered steps via status.Step - teardown.go: all sections via status.Section - providers.go: per-provider status via status.OK/Info - new.go: WARNING → status.Warn, sections → status.Section - teardownProviders: brief retry on sandbox-mid-deletion race TODO.md: migration status updated to 11/12 native Go. Validated: unit 47+7, bats 29+29, podman 19+19, Go+OCP 17/17. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses issues #23, #24, #27 from the code audit. Interface narrowing, output consistency, and code deduplication.
Gateway interface split (#27)
Split 22-method monolith into focused sub-interfaces aligned with OpenShell proto domains:
Gateway composes all four. profile.ValidateProviders now accepts ProviderChecker (1 method) instead of full Gateway — mock went from 24 stub methods to 1.
Code deduplication (#24)
k8s.DefaultNamespace()— was duplicated in 3 cmd filesk8s.FileExists()— was duplicated in cmd/providers.go + launcherOutput standardization (#23)
All cmd/ files now use status.* helpers:
status.Warn,Warnf,Infof,Detailf,Step,Donestatus.Stepstatus.Sectionstatus.OK/Infostatus.Warn, sections →status.SectionTest results
Closes #23, #24, #27.